Installation
------------

Home directory
^^^^^^^^^^^^^^

Install SieveManager to your home directory::

    make userinstall

Manual pages are copied to :file:`~/.local/share/man`.
Consult the manual of your system's :command:`man` or your shell
on how to add that directory to your :envvar:`MANPATH`.

The Bash completion script is copied to
:file:`~/.local/share/bash-completion/completions`,
the Zsh completion script to
:file:`~/.local/share/zsh-completions`.


Virtual environment
^^^^^^^^^^^^^^^^^^^

Store the installation directory in :envvar:`venvdir`::

    venvdir=/opt/odkr/sievemgr

Create a virtual environment in :envvar:`venvdir`,
install SieveManager to that virtual environment, and
symlink :command:`sievemgr` into a directory in the
system's :envvar:`PATH`::

    sudo make venvdir="${venvdir:?}" virtinstall
    sudo ln -s "${venvdir:?}/bin/sievemgr" /usr/local/bin

.. TIP::
    Install SieveManager to :envvar:`venvdir`, but copy the manual pages
    to :file:`/usr/local/share/man`, the Bash completion script to
    :file:`/usr/local/share/bash-completion/completions`, and the Zsh
    completion script to :file:`/usr/local/share/zsh-completions`::

        sudo make venvdir="${venvdir:?}" prefix=/usr/local virtinstall


Manual
^^^^^^

SieveManager can also be installed by being copied into a
directory in your :envvar:`PATH`::

    install sievemgr.py ~/.local/bin/sievemgr

However, the cryptography_ module is required to check whether a server's TLS
certificate has been revoked and the dnspython_ module is required to resolve
DNS `SRV records`_. So you should install those modules, too::

    pip3 install cryptography dnspython


De-installation
---------------

Uninstall SieveManger::

    make uninstall

.. NOTE::
    The :mod:`cryptography` and :mod:`dnspython` modules are
    installed automatically by :command:`make userinstall` and
    :command:`make virtinstall`. But they are *not* uninstalled
    by :command:`make uninstall`.


.. _cryptography: https://cryptography.io

.. _dnspython: https://www.dnspython.org
